//
//  ComicCollectionViewCell.m
//  SweetComics
//
//  Created by LeeZhe on 15/3/6.
//  Copyright (c) 2015年 LeeZhe. All rights reserved.
//

#import "ComicCollectionViewCell.h"

@implementation ComicCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 漫画图片
        self.imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageView];
        _imageView.image = [UIImage imageNamed:@"replace.png"];
        [_imageView release];
        self.leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_leftButton];
        self.centerButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_centerButton];
        self.rightButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_rightButton];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _imageView.frame = CGRectMake(0,15,self.contentView.frame.size.width, self.contentView.frame.size.height - 30);
    _leftButton.frame = CGRectMake(0,0, self.contentView.frame.size.width / 4, self.contentView.frame.size.height);
    _centerButton.frame = CGRectMake(self.contentView.frame.size.width / 4, 0, self.contentView.frame.size.width / 2, self.contentView.frame.size.height);
    _rightButton.frame = CGRectMake(self.contentView.frame.size.width * 3 / 4,0, self.contentView.frame.size.width / 4, self.contentView.frame.size.height);
    
}

@end
